<script type="text/babel">
  import $ from 'jquery'
  export default {
    ready: function () {
      var self = this
      var focusableEle = self.focusableElement()
      if (focusableEle) {
        $(focusableEle).attr('tabindex', 0)
        $(focusableEle).css('outline', 'none')
        $(focusableEle).focus(function (event) {
          self.$dispatch('on-view-focus', self)
        })
        $(focusableEle).blur(function (event) {
          self.$dispatch('on-view-blur', self)
        })
      }
    },
    methods: {
      requestFocus: function () {
        $(this.focusableElement()).focus()
      },
      requestBlur: function () {
        $(this.focusableElement()).blur()
      },
      focusableElement: function () {
        return this.$els.focusableEl
      },
      createMaskElement: function () {
      },
      onFocusView: function (element, done) {
      },
      onBlurView: function (element, done) {
      },
      performClick: function () {
        this.$dispatch('on-view-click', this)
      }
    }
  }
</script>